<template>
  <div>
    <v-header title="我的"></v-header>
    <div class="my_top">
      <!-- 个人信息 -->
      <div id="user_msg">
        <div class="my_left">
          <div class="user_icon" :style="'background-image: url('+'http://localhost:3000' +img+');'"></div>
          <div class="user_name">
            <h2>{{ name }}</h2>
            <h3>完善资料让小U更懂你</h3>
          </div>
        </div>
        <div class="signin">
          <van-icon name="bill" />
          每日签到
        </div>
      </div>
      <!-- 用户的数据信息 -->
      <div class="user_data">
        <div>
          <h2>12</h2>
          <p>我的收藏</p>
        </div>
        <div>
          <h2>12</h2>
          <p>浏览记录</p>
        </div>
        <div>
          <h2><span>￥</span>0</h2>
          <p>我的红包</p>
        </div>
        <div>
          <h2>12</h2>
          <p>优惠券</p>
        </div>
      </div>
      <!-- 订单得各个数据 -->
      <div class="my_order ma">
        <div class="my_ord_title">
          <h2 class="clearfix">
            我的订单<span class="fr">全部订单&nbsp;></span>
          </h2>
        </div>
        <div class="my_ord_data">
          <div>
            <img src="./img/payment.png" alt="" />
            <p>待付款</p>
          </div>
          <div>
            <img src="./img/delivery.png" alt="" />
            <p>待收货</p>
          </div>
          <div>
            <img src="./img/evaluation.png" alt="" />
            <p>评价</p>
          </div>
          <div>
            <img src="./img/service.png" alt="" />
            <p>售后/退款</p>
          </div>
        </div>
      </div>
    </div>
    <!-- 功能区 -->
    <main id="my_fun">
      <p class="clearfix" @click="toAddress">
        <van-icon name="location-o" />
        地址管理
        <span class="fr">></span>
      </p>
      <p class="clearfix">
        <van-icon name="paid" />
        我的钱包
        <span class="fr">剩余200U币&nbsp;></span>
      </p>
      <p class="clearfix">
        <van-icon name="qr" />
        我的二维码
        <span class="fr">></span>
      </p>
      <p class="clearfix">
        <van-icon name="friends-o" />
        我的小伙伴
        <span class="fr">></span>
      </p>
      <p class="clearfix">
        <van-icon name="gold-coin-o" />
        0元试用
        <span class="fr">></span>
      </p>
    </main>
  </div>
</template>

<script>
export default {
  created(){
    this.name=JSON.parse(localStorage.getItem("userInfo")).nickname
    this.img=JSON.parse(localStorage.getItem("userInfo")).avatarurl
  },
  data(){
    return{
      name:'',
      img:'',
    }
  },
  methods:{
    toAddress(){
      this.$router.push('/address')
    }
  }
};
</script>

<style scopes>
.my_top {
  height: 2rem;
  background-image: linear-gradient(180deg, #FF6040 0%, #FF8A80 100%);
  box-shadow: 0 0.02rem 0.06rem 0 rgba(255, 149, 128, 0.5);
  padding-top: 0.1rem;
}
#user_msg {
  display: flex;
  justify-content: space-between;
  height: 0.64rem;
  align-items: center;
  margin-left: 0.1rem;
}
#user_msg .my_left {
  display: flex;
  justify-content: space-around;
}
#user_msg .user_icon {
  width: 0.64rem;
  height: 0.64rem;
  /* background-image: url(../images/user.jpg); */
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 50% 50%;
}
#user_msg .user_name {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 0.64rem;
  margin-left: 0.1rem;
}
#user_msg .user_name h2 {
  font-family: PingFangSC-Semibold;
  font-size: 0.18rem;
  color: #FFFFFF;
  line-height: 0.18rem;
  font-weight: 600;
}
#user_msg .user_name h3 {
  height: 0.16rem;
  border: 0.01rem solid #FFFFFF;
  border-radius: 0.01rem;
  font-family: PingFangSC-Regular;
  font-size: 0.1rem;
  color: #FFFFFF;
  line-height: 0.16rem;
}
#user_msg .signin {
  background: #FFD4CC;
  border: 0 solid #FFFFFF;
  border-radius: 0.1rem 0 0 0.1rem;
  width: 0.9rem;
  height: 0.2rem;
  font-family: PingFangSC-Regular;
  font-size: 0.1rem;
  color: #FF6243;
  text-align: left;
  line-height: 0.1rem;
}
#user_msg .signin svg {
  margin-left: 0.08rem;
  width: 0.16rem;
  height: 0.16rem;
}
.user_data {
  height: 0.6rem;
  display: flex;
  align-items: center;
}
.user_data div {
  width: 25%;
}
.user_data div h2 {
  font-family: PingFangSC-Semibold;
  font-size: 0.18rem;
  color: #FFFFFF;
  text-align: center;
  line-height: 0.14rem;
}
.user_data div h2 span {
  font-size: 0.1rem;
  color: #FFFFFF;
  text-align: center;
  line-height: 0.08rem;
}
.user_data div p {
  font-family: PingFangSC-Light;
  font-size: 0.1rem;
  color: #FFFFFF;
  text-align: center;
  line-height: 0.1rem;
  margin-top: 0.05rem;
}
.my_order {
  padding: 0.1rem;
  width: 3.35rem;
  height: 0.83rem;
  border-radius: 0.04rem;
  background-color: #fff;
}
.my_order .my_ord_title h2 {
  font-family: PingFangSC-Semibold;
  font-size: 0.16rem;
  color: #333333;
  line-height: 0.16rem;
  font-weight: 600;
}
.my_order .my_ord_title h2 span {
  font-family: PingFangSC-Regular;
  font-size: 0.12rem;
  color: #FF6040;
  line-height: 0.12rem;
  font-weight: normal;
}
.my_ord_data {
  margin-top: 0.15rem;
  display: flex;
}
.my_ord_data div {
  width: 25%;
}
.my_ord_data div img {
  margin: 0 auto;
  display: block;
  width: 0.32rem;
  height: 0.32rem;
}
.my_ord_data div P {
  font-family: PingFangSC-Light;
  font-size: 0.1rem;
  color: #333333;
  text-align: center;
  line-height: 0.1rem;
  margin-top: 0.05rem;
}
#my_fun {
  margin-top: 0.36rem;
  background-color: #fff;
  overflow: hidden;
  padding: 0.2rem 0.1rem 0 0.1rem;
}
#my_fun P {
  font-family: PingFangSC-Semibold;
  font-size: 0.12rem;
  color: #333333;
  line-height: 0.12rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
#my_fun P i {
  color: #FF6040;
  font-size: 0.16rem;
  margin-right: 0.05rem;
}
#my_fun P span {
  font-size: 12px;
  color: #666666;
  line-height: 12px;
  font-weight: normal;
}
</style>